Cookie Consent by Free Privacy Policy Generator

O365 Mailbox Size

List the size of your o365 Mailboxes with powershell

 · 1 Minuten Lesezeit

Use this code to list your o365 mailboxes with actual size.


# Verbindung zu Exchange Online herstellen
Connect-ExchangeOnline -ShowProgress $true

# Alle Postfächer abrufen und Postfachgröße ermitteln
$Mailboxes = Get-Mailbox -ResultSize Unlimited |
   Get-MailboxStatistics |
   Select-Object DisplayName,
                 @{Name="TotalItemSize (MB)";Expression={[math]::Round(($_.TotalItemSize.Value.ToBytes()/1MB),2)}},
                 ItemCount,
                 LastLogonTime |
   Sort-Object "TotalItemSize (MB)" -Descending

# Ergebnisse in eine CSV-Datei exportieren
$Mailboxes | Export-Csv -Path "MailboxSizes.csv" -NoTypeInformation -Encoding UTF8

# Ergebnisse in der Konsole anzeigen
$Mailboxes | Format-Table -AutoSize

# Verbindung trennen
Disconnect-ExchangeOnline -Confirm:$false

No comments yet.

Einen Kommentar hinzufügen
"Strg + Enter" um Kommentar hinzuzufügen